#pragma once
#include <iostream>
class Bitmap {
private:
	unsigned int* bits;
	int _size; 
	int *refer_count;
public:
	explicit Bitmap(int len);
	Bitmap(const Bitmap& m);
	class Reference {
	private:
		Bitmap& m;
		size_t pos;
	public:
		Reference(Bitmap& m, size_t pos);
		void operator=(const bool& val);
		operator bool() {
			return m.getBit(pos);
		}
	};
	Bitmap();
	~Bitmap();
	size_t size();
	void setBit(int pos,const bool val=true);
	bool getBit(size_t pos) const ;
	bool less(const Bitmap& other) const;
	bool operator<(const Bitmap& other) const;
	bool operator==(const Bitmap& other);
	bool operator[](size_t pos) const;
	Reference operator[](size_t pos);
};